package aplicacion.proxy;

import java.util.Hashtable;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import fac.Facade;
import framework.ProxyModelo;

public class ProxyGenEnvT extends ProxyModelo{
	
	@SuppressWarnings({ "unchecked", "unchecked", "unchecked" })
	public ProxyGenEnvT()
	{
		
		super();
		String naming = "FacadeEAR/FacadeBean/remote";
		Hashtable props = new Hashtable();
		props.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
		props.put(InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099");
		InitialContext ic;
		
		try {
			ic = new InitialContext(props);
			Facade a=(Facade)ic.lookup(naming);
			if(a!=null)
			{
				System.out.println("Se logro conectar al JBoss");
			}
			
			a.EnvT();//Generar envio a tienda
			a.doPersist(); //prueba persistencia
			
		} catch (NamingException e) {
			System.out.println("Error al conectarse al JBoss");
			e.printStackTrace();
		}
	}




}
